package cn.sail.shop3.api.service.impl;

import cn.sail.shop3.api.dao.GoodsDao;
import cn.sail.shop3.api.dao.impl.GoodsDaoImpl;
import cn.sail.shop3.api.entity.Goods;
import cn.sail.shop3.api.service.GoodsService;

import java.util.List;

public class GoodsServiceImpl implements GoodsService {
    private GoodsDao goodsDao = new GoodsDaoImpl();

    @Override
    public List<Goods> listAll() {
        List<Goods> goodsList = goodsDao.selectList();
        System.out.println(goodsList);
        return goodsList;
    }

    @Override
    public Goods goodsById(Long id) {
        Goods goodsId = goodsDao.selectById(id);
        System.out.println(goodsId);
        return goodsId;
    }
}
